ass Solution {
public:
    uint32_t reverseBits(uint32_t n) {
        size_t ret;
        for(int i=0;i<32;i++)
        {
            ret<<=1;
            ret+= (n&1);
            n>>=1;
        }
        return ret;
    }
};

class Solution {
public:
    char findTheDifference(string s, string t) {
        if(s=="")
        return t[0];

        map<char,int> less;
        map<char,int> more;
        for(auto e:s)
        {
            less[e]++;
        }
        for(auto e:t)
        {
            more[e]++;
        }

        for(auto e:more)
        {
            if(less.find(e.first)==less.end() || more.find(e.first)->second>
            less.find(e.first)->second)
            {
                return e.first;
            }
        }
        return 0;
    }
};

class Solution {
public:
    int countGoodSubstrings(string s) {
        if(s.size()<3)
        return 0;
        
        multiset<string> ret;
        for(int i=0;i<s.size()-2;i++)
        {   //循环字符串里面有多少个子串
            string tmp{s[i],s[i+1],s[i+2]};//initializer_list
            {
                if(s[i]!=s[i+2] && s[i]!=s[i+1] && s[i+1]!=s[i+2])
                ret.insert(tmp);
            }
        }
        return ret.size();
    }
};


class Solution {
public:
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * 
     * @param arr intvector 
     * @param k int 
     * @return int
     */
    int foundOnceNumber(vector<int>& arr, int k) {
        // write code here
        map<int,int> mp;
        for(auto &e:arr)
        {
            mp[e]++;
        }
        for(auto it:mp)
        {
            if(it.second==1)
            return it.first;
        }
        return 0;
    }
};

